﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using System.Data;

namespace DAL
{
    public class ColumnTypeDAL: DB
    {
        public ColumnTypeDAL(LoginInfo info)
        {
            base.loginInfo = info;
        } 
        public IList<ColumnTypeEntity> GetList()
        {
            IList<ColumnTypeEntity> result = new List<ColumnTypeEntity>();
            try
            {
                HIDB.dbo conn = base.conn();
                DataTable dt = conn.StoredDataTable("[Working_db].[UP_GetColumnTypeList]");
                if (dt != null && dt.Rows.Count > 0)
                {
                    ColumnTypeEntity model = null;
                    foreach (DataRow item in dt.Rows)
                    {
                        model = new ColumnTypeEntity();
                        model.ColumnType = item["ColumnType"].ToString();
                        model.ColumnTypeName = item["ColumnTypeName"].ToString();

                        result.Add(model);
                    }
                }
            }
            catch (Exception)
            {

                throw;
            }
            return result;
        }
    }
}
